import React from "react";
import { history } from "umi";
import { useMobxStore } from "@/mobx/store";

const useLogout = () => {
    const { MyData: {
        changeUserInfo
    } } = useMobxStore()

    const todoLogout = () => {
        history.replace('/login')
        sessionStorage.removeItem('qftoken')
        changeUserInfo({})
    }

    return [
        todoLogout
    ]
}

export default useLogout